#!/bin/python3
#-*- coding: utf-8 -*-
# exp_19.py
# @author 刘秋
# @email lq@aqiu.info
# @description 
# @created 2020-04-16T10:17:32.414Z+08:00
# @last-modified 2020-04-16T10:21:46.673Z+08:00
#

#一个数如果恰好等于它的因子之和，这个数就称为"完数"。例如6=1＋2＋3.编程找出1000以内的所有完数。

for i in range(1000):
    k = []
    n = -1
    s = i
    for j in range(1,i):
        if i % j ==0:
            n +=1
            s -=j
            k.append(j)
    if s ==0 :
        print(i)
        print(k)